<style type="text/css">
#countStock {
	margin-top: 10px;
}
#countStock p{
	margin-right:10px;
}
#scanForm {
	margin-bottom: 10px;
}
a,a:hover {
	text-decoration: none;
}
</style>
<div class="pageheader">
	<h2>
		<i class="fa fa-pencil-square"></i>库存管理
	</h2>
	<div class="breadcrumb-wrapper">
		<span class="label">你所在的位置：</span>
		<ol class="breadcrumb">
			<li><a href="/index">ERP管理系统</a></li>
			<li>库存管理</li>
			<li class="active">更新盘点</li>
		</ol>
	</div>
</div>
<div class="contentpanel">
<div class="main">
<?php //dump($this->msg);?>
    <?php if($this->msg == 'success'){?>
    <h5>更新成功！</h5>
    <?php }else{?>
    <form id="updateInventory" method="post" action="/stock/updateinventory">
        <?php if (empty($this->exitlist)){ ?>
        <div class="form-group">
            <input placeholder="选择更新第几次盘点(请填阿拉伯数字)" name="times" class="form-control" name="title">
        </div>
        <?php }else{ ?><a>
        <input class="btn btn-primary" type="hidden" value="<?php echo $this->times?>" name="times"></a>
        <?php } ?>
        <div class="table-responsive">
            <table class="table table-bordered table-hover">
                <thead>
                    <tr>
                        <th>SKU</th>
                        <th>产品名称</th>
                        <th>尺码</th>
                        <th>本次扫描值</th>
                        <th>系统库存实际值</th>
                        <th>永不下架</th>
                    </tr>
                </thead>
                <tbody>      
                    <?php 
                    if ($this->exitlist){
                    	$i = 0;
                    	$num = 0;
                    	foreach ($this->exitlist as $v){ 
                    		$i++;
                    		$num = $num + $this->sizeid[$v['id']];
                    ?>
                    <tr class="<?php if($v['t_value'] != $this->sizeid[$v['id']]){echo 'danger';}else{echo 'info';}?>">
                        <td>
                            <a target="_blank" href="/stock/update?id=<?php echo $v['stock_id'];?>"><?php echo $v['sku'];?></a>
                        </td>
                        <td>
                            <?php echo $v['title'];?>
                        </td>
                        <td>
                            <?php echo $v['size'];?>
                        </td>
				        <td>
				            <?php echo $this->sizeid[$v['id']]; ?></td>
				        <td><?php echo $v['t_value']; ?></td>
				        <td><?php echo $v['is_forlong']?'是':'否'; ?></td>
			        </tr>
			        <?php 
                    	} 
                    }
                   ?>
                   <tr><td>SKU个数：<?php echo $i; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;扫描件数：<?php echo $num; ?></td></tr>
		        </tbody>
            </table>
        </div>
        <?php if (empty($this->exitlist)){ ?>
        <input class="btn btn-primary" type="submit" value="确定">
        <?php }else{ ?>
        <input class="btn btn-primary" type="hidden" value="true" name="flag">
        <input class="btn btn-primary" type="submit" value="更新">
        <a href="/missingstock.csv" class="btn btn-primary">导出Excel：系统记录存在但仓库不存在的库存值</a>
        <?php } ?>
    </form>
    <?php } ?>
</div>
</div>
